package com.cy.service;

import com.cy.bfzcommons.mapper.LogsMapper;
import com.cy.bfzcommons.pojo.Logs;
import com.cy.bfzcommons.service.LogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogsServiceImpl implements LogsService {
    @Autowired
    private LogsMapper logsMapper;

    @Override
    public List<Logs> selectLogs() {
        return logsMapper.selectList(null);
    }

    @Override
    public void insertLogs(Logs logs) {
         logsMapper.insert(logs);
    }

    @Override
    public Integer deleteLogs() {
        return logsMapper.delete(null);
    }

    @Override
    public List<Logs> selectLike(String username, String operation, String created) {
//
//        QueryWrapper<Logs> queryWrapper = new QueryWrapper<>();
//        QueryWrapper<Logs> queryWrapper1 = new QueryWrapper<>();
//        queryWrapper.like(!StringUtil.isEmpty(logs.getUsername()), "username", logs.getUsername())
//                .and(!StringUtil.isEmpty(logs.getOperation()), );
//
        List<Logs> list =  logsMapper.selectLike(username,operation,created);
        return list;
    }
}
